<%@page import="ca.concordia.soen6461.wichf.navigation.view.CartView.Appointment"%>
<%@ page language="java" 
	contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1" 
    import="java.util.*,java.sql.*,java.text.*,java.lang.*,java.io.*"
%>
<%@page import="ca.concordia.soen6461.wichf.navigation.view.CartView"%>

<%
CartView.Bean bean = (CartView.Bean) request.getAttribute("view");
%>

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Appointment Cart</title>
<script language="javascript" type="text/javascript">
</script>
</head>
<body>
<jsp:include page="/header.jsp"></jsp:include>
<a href="?event=BackEvent">Back</a>
&nbsp;
<fieldset>
<legend><b>View Cart</b></legend>
<h3 align=center> Select the Appointments</h3>
<p align=center>Please confirm the appointments below and make payment.</p>
<form name="cart" method="post">
<jsp:include page="/messages.jsp"></jsp:include>
<table width="50%" align="center" cellpadding="5" cellspacing="0" bgcolor="#D5FFD5">
<tr><td>&nbsp;</td><tr>
<% 
 String[] headings = new String[]{"Select","Date","Annual/Regular","Price"};
 for (int i =0;i<headings.length;i++) {
 %>
 <th height="25"><div align="center"><%=headings[i].toString()%></div></th>
<% 
}
%>
<%
  for (int j=0;j<bean.getAppointments().size();j++) {
	CartView.Appointment appointment = bean.getAppointments().get(j); 
%>
<tr><td height="25"><div align="center"><input name="item.<%=j%>" type="checkbox" /></div></td>
<td height="25"><div align="center">
<%=appointment.getDate()%>
</div></td>
<td height="25"><div align="center">
<%=appointment.getType()%>
</div></td>
<td height="25"><div align="center">
<%=appointment.getPrice()%>
</div></td>
</tr>
<%
  }
%>
<tr><td>&nbsp;</td><tr>
<tr><td height="40" colspan="4" align="right">
<% if (!bean.getAppointments().isEmpty()) { %>
<input type="submit" name="CheckoutEvent" value="Checkout" />
<% } %>
</td></tr>
<tr><td>&nbsp;</td><tr>
</table>
</form>
</fieldset>
</body>

</html> 